import axiosData from "@/api/axios";
export default {
  /**
   * @description: 查询备件管理
   * @param {Number}  page*
   * @param {Number}  size*
   * @param {Object}   entity
   */
  queryPageList(params) {
    return axiosData.post('/v3/equipment-hitch/spareParts/queryPageList', params);
  },
  /**
   * @description: 查询备件使用统计
   * @param {Number}  page*
   * @param {Number}  size*
   * @param {Object}   entity
   */
  queryInfoPageList(params) {
    return axiosData.post('/v3/equipment-hitch/spareParts/queryInfoPageList', params);
  },
  /**
   * @description: 条件查询备件
   * @param {Number}   equipmentCode
   */
  queryByCondition(params) {
    return axiosData.post(`v3/equipment-hitch/spareParts/queryByCondition`, params);
  },
  /**
 * @description: 查看备件使用记录
 * @param {Number}   equipmentCode
 */
  queryHistory(sparePartsCode) {
    return axiosData.get(`v3/equipment-hitch/spareParts/queryHistory?sparePartsCode=${sparePartsCode}`);
  },
  /**
   * @description: 添加一条数据
   * @param {Object}  *
   */
  add(params) {
    return axiosData.post('/v3/equipment-hitch/spareParts/add', {
      ...params,
      farmingTypeNo: sessionStorage.farmingTypeNo,
      farming: sessionStorage.farming
    });
  },
  /**
   * @description: 批量删除
   * @param {Object}  *
   */
  delList(params) {
    return axiosData.post('/v3/equipment-hitch/spareParts/delList', params);
  },
  /**
   * @description: 修改
   * @param {Object}  *
   */
  edit(params) {
    return axiosData.post('/v3/equipment-hitch/spareParts/edit', params);
  }
};
